﻿using Ruici.Web.Services;
using Ruici.Web.Services.CRS_Service;
using System;
using System.Collections.Generic;
using Ruici.Web.Services.Model;
using DoctorSchedule = Ruici.Web.Services.CRS_Service.DoctorSchedule;

namespace Ruici.BLL
{
    public class DocInfoBll
    {
        private DocInfoService docInfoService = new DocInfoService();

        public List<Web.Services.Model.ArticleResponse> GetArticleList(string channel_name, int category_id, int page_size, int page_index, string keys,string filter, out int totalcount)
        {
            List<Web.Services.Model.ArticleResponse> articlemodel = docInfoService.GetArticleList(channel_name, category_id, page_size, page_index, keys, filter, out totalcount);
            return articlemodel;
        }

        public List<Web.Services.Model.ArticleResponse> GetArticleListForDoctor(string channel_name, int category_id, int page_size, int page_index, string keys, string filter, out int totalcount)
        {
            List<Web.Services.Model.ArticleResponse> articlemodel = docInfoService.GetArticleList(channel_name, category_id, page_size, page_index, keys, filter, out totalcount);
            return articlemodel;
        }

        public List<DoctorSchedule> GetDoctorScheduleByDate(int docID, DateTime startDate, DateTime endDate)
        {
            var doctorSchedule = docInfoService.GetDoctorScheduleByDate(docID, startDate, endDate);
            List<DoctorSchedule> doctorList = new List<DoctorSchedule>();

            doctorList = new List<DoctorSchedule>(doctorSchedule.Data);
            return doctorList;
        }

        public string[] GetDoctorScheduleDates(int docID, DateTime startDate, DateTime endDate)
        {
            var doctorSchedule = docInfoService.GetDoctorScheduleDates(docID, startDate, endDate);
            string[] cdoctorList = doctorSchedule.Data.ToArray();
            return cdoctorList;
        }
        
        public List<Web.Services.Model.ActiviteDoctorInfoResponse> GetDoctorList(int? deptID, int? titleID, string keyword, int page=1, int pageSize=10)
        {
            var doctorList = docInfoService.GetDoctorList(deptID, titleID, pageSize, keyword: keyword, page:1);
            return doctorList;
        }

        public ReturnModel GetReservationByCondition(string startime, string endtime, int orgId, int mzId, int docId, string outpatientNo, string reseNo, string patientName, string credType, string credNo, string userNo, string userName, int status)
        {
            var doctorList = docInfoService.GetReservationByCondition(startime, endtime, orgId, mzId, docId, outpatientNo, reseNo, patientName, credType, credNo, userNo, userName, status);
            return doctorList;
        }

        public List<DoctorInfoResponse> GetDoctorListById(string docIdList)
        {
            var doctorList = docInfoService.GetDoctorListById(docIdList);
            return doctorList;
        }

        public Web.Services.Model.DoctorInfoResponse GetDoctor(string id)
        {
            var doctorinfo = docInfoService.GetDoctor(id);
            return doctorinfo;
        }

        public List<Web.Services.Model.DeptInfoResponse> GetDeptList()
        {
            List<Web.Services.Model.DeptInfoResponse> deptmodel = docInfoService.GetDeptList();

            return deptmodel;
        }

        public List<Web.Services.Model.TitleInfoResponse> GetTitleList()
        {
            List<Web.Services.Model.TitleInfoResponse> titlemodel = docInfoService.GetTitleList();
            return titlemodel;
        }
    }
}
